package com.financing.wap.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.wap.dao.IFpShopPlayopenApplyDao;
import com.financing.wap.dto.FpShopPlayopenApplyDTO;
import com.financing.wap.service.IFpShopPlayopenApplyService;
import com.financing.wap.util.DTOdateSetUtil;
/**
 * fp_shop_playopen_apply  
 * 金策师直播平台开通申请 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopPlayopenApplyService")
public class FpShopPlayopenApplyServiceImpl implements IFpShopPlayopenApplyService{

	@Autowired
	private IFpShopPlayopenApplyDao fpShopPlayopenApplyDao;

	@Override
	public int insert(FpShopPlayopenApplyDTO fpShopPlayopenApply) throws SQLException {
		DTOdateSetUtil.setCreateInfo(fpShopPlayopenApply);
		DTOdateSetUtil.setUpdateInfo(fpShopPlayopenApply);
		fpShopPlayopenApply.setDeleteTag("1");
		return fpShopPlayopenApplyDao.insert(fpShopPlayopenApply);
	}

	@Override
	public void update(FpShopPlayopenApplyDTO fpShopPlayopenApply) throws SQLException {
		DTOdateSetUtil.setUpdateInfo(fpShopPlayopenApply);
		fpShopPlayopenApplyDao.update(fpShopPlayopenApply);
	}

	@Override
	public void updateForce(FpShopPlayopenApplyDTO fpShopPlayopenApply) throws SQLException {
		DTOdateSetUtil.setUpdateInfo(fpShopPlayopenApply);
		fpShopPlayopenApplyDao.updateForce(fpShopPlayopenApply);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fpShopPlayopenApplyDao.delete(id);
	}
	
	@Override
	public List<FpShopPlayopenApplyDTO> queryList(FpShopPlayopenApplyDTO fpShopPlayopenApply) throws SQLException {
		return fpShopPlayopenApplyDao.queryList(fpShopPlayopenApply);
	}

	@Override
	public int queryListCount(FpShopPlayopenApplyDTO fpShopPlayopenApply) throws SQLException {
		return fpShopPlayopenApplyDao.queryListCount(fpShopPlayopenApply);
	}

	@Override
	public FpShopPlayopenApplyDTO loadById(Integer id) throws SQLException {
		return fpShopPlayopenApplyDao.loadById(id);
	}
 	@Override
	public FpShopPlayopenApplyDTO queryListGetFirst(FpShopPlayopenApplyDTO fpShopPlayopenApply)
			throws SQLException {
		 List<FpShopPlayopenApplyDTO> queryList = queryList(fpShopPlayopenApply);
		 if(queryList==null||queryList.size()==0){
			 return new FpShopPlayopenApplyDTO();
		 }
		 return queryList.get(0);
	}
}
